import glob
from skimage import io
import cv2
import numpy as np
from matplotlib import pyplot as plt
import json
from torchvision import transforms as t_trans
from albumentations import *
from PIL import Image
import torch
import os


def run():
    for ix, ig_pth in enumerate(glob.glob('F:/sky/*')):
        ig = cv2.imread(ig_pth)
        h, w = ig.shape[0:2]
        scale_factor = 1280/w
        ig = cv2.resize(ig, dsize=None, fx=scale_factor, fy=scale_factor)
        ig = ig[0:720,:,:]
        cv2.imwrite(str(ix)+'.jpg', ig)
        '''
        ig = cv2.cvtColor(ig, cv2.COLOR_BGR2RGB)
        plt.imshow(ig)
        plt.show()
        '''






if __name__ == '__main__':
    run()



